#ifndef NET_CALLBACK_H
#define NET_CALLBACK_H

#include "Buffer.h"
#include "utility/chrono.h"

#include <functional>
#include <memory>


class TCPConnection;
using TCPConnectionPtr = std::shared_ptr<TCPConnection>;
using ConnectionCallback = std::function<void(const TCPConnectionPtr &)>;
using CloseCallback = std::function<void(const TCPConnectionPtr &)>;
using DrainCallback = std::function<void(const TCPConnectionPtr &)>;
using HighWaterMarkCallback = std::function<void(const TCPConnectionPtr &, size_t)>;
using MessageCallback = std::function<void(const TCPConnectionPtr &, Buffer &, Utility::timepoint)>;


inline void default_connection_func(const TCPConnectionPtr &/*unused*/) {}
inline void default_message_func(
    const TCPConnectionPtr & /*unused*/, Buffer &/*unused*/, 
    Utility::timepoint /*unused*/) {}

namespace Callback {

void default_connection(const TCPConnectionPtr &connection);
void default_message(const TCPConnectionPtr &connection, Buffer &buffer, Utility::timepoint t);

}

#endif